#ifndef RADIOMICSALGORITHM_H
#define RADIOMICSALGORITHM_H

#include <QObject>
#include "AlgorithmShare.h"
struct AlgoParam;
class AbstractAlgorithm;

class RadiomicsAlgorithm : public QObject
{
    Q_OBJECT
public:
    explicit RadiomicsAlgorithm(QObject *parent = 0);
    ~RadiomicsAlgorithm();

    void setAlgorithmCombo(const AlgoCombo &combo) { m_combo = combo; }
    const AlgoCombo &getAlgorithmCombo() const { return m_combo; }
    const AlgoStringTables &getAlgoStringTables() const { return m_strTables; }
    void setSeriesVolume(const ushort **pVolume, ulong width, ulong height, ulong slice);
    void setSeedInfo(int x, int y, int z, int val, int area);
    void getTumorMask(const uchar **&pMask, int &start, int &count) const;
    void getPredictResult(double &svmScore, double &nstageScore) { svmScore = m_predParam->r_svm; nstageScore = m_predParam->r_nstage; }

signals:
    void segmentFinished(bool ok, const QString &msg);
    void extractFinished(bool ok, const QString &msg);
    void predictFinished(bool ok, const QString &msg);

public slots:
    void doSegment();
    void doExtract();
    void doPredict();
    void clearParam();

    void terminate();

private:
    AlgoStringTables m_strTables;
    AlgoCombo m_combo;
    AlgoParam *m_param;
    PredictParam *m_predParam;
    AbstractAlgorithm *algo;
};

#endif // RADIOMICSALGORITHM_H
